package com.fr.report.highlight;

import com.fr.base.FRContext;
import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLableReader;
import com.fr.report.CellElement;
import com.fr.report.js.NameJavaScriptGroup;
import com.fr.report.script.Calculator;
import java.util.logging.Level;
import java.util.logging.Logger;

public class HyperlinkHighlightAction extends AbstractHighlightAction
{
  private NameJavaScriptGroup jsGroup;

  public HyperlinkHighlightAction()
  {
  }

  public HyperlinkHighlightAction(NameJavaScriptGroup paramNameJavaScriptGroup)
  {
    this.jsGroup = paramNameJavaScriptGroup;
  }

  public void setHyperlink(NameJavaScriptGroup paramNameJavaScriptGroup)
  {
    this.jsGroup = paramNameJavaScriptGroup;
  }

  public NameJavaScriptGroup getHperlink()
  {
    return this.jsGroup;
  }

  public void action(CellElement paramCellElement, Calculator paramCalculator)
  {
    if (paramCellElement == null)
      return;
    try
    {
      paramCellElement.setNameHyperlinkGroup((NameJavaScriptGroup)this.jsGroup.clone());
    }
    catch (CloneNotSupportedException localCloneNotSupportedException)
    {
      FRContext.getLogger().log(Level.WARNING, localCloneNotSupportedException.getMessage(), localCloneNotSupportedException);
    }
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    if ((paramXMLableReader.isChildNode()) && ("NameJavaScriptGroup".equals(paramXMLableReader.getTagName())))
    {
      NameJavaScriptGroup localNameJavaScriptGroup = new NameJavaScriptGroup();
      paramXMLableReader.readXMLObject(localNameJavaScriptGroup);
      setHyperlink(localNameJavaScriptGroup);
    }
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    if (this.jsGroup != null)
      this.jsGroup.writeXML(paramXMLPrintWriter);
  }

  public boolean equals(Object paramObject)
  {
    if (!(paramObject instanceof HyperlinkHighlightAction))
      return false;
    HyperlinkHighlightAction localHyperlinkHighlightAction = (HyperlinkHighlightAction)paramObject;
    if ((this.jsGroup == null) || (localHyperlinkHighlightAction.jsGroup == null))
      return ((localHyperlinkHighlightAction.jsGroup == null) && (this.jsGroup == null));
    return this.jsGroup.equals(localHyperlinkHighlightAction.jsGroup);
  }
}